package com.example.smart.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.example.smart.enums.AccountStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "用户")
public class User {
    @Schema(description = "用户编号")
    @TableId(type = IdType.AUTO)
    private Integer userId;
    @Schema(description = "用户名")
    private String userName;
    @Schema(description = "用户姓名")
    private String userRename;
    @Schema(description = "用户性别（男: 1，女:2）")
    private Integer userSex;
    @Schema(description = "用户密码")
    private String password;
    @Schema(description = "用户加盐")
    private String userSalt;
    @Schema(description = "联系电话")
    private String userPhone;
    @Schema(description = "邮箱")
    private String userEmail;
    @Schema(description = "用户头像")
    private String userAvatar;
    @Schema(description = "个人简介")
    private String userBio;
    @Schema(description = "用户状态（0：正常，1：冻结，2：黑名单，3：停用，4：封号）")
    private Integer userStatus;
    /*@Enumerated(EnumType.ORDINAL)
    private AccountStatus userStatus;*/
    @Schema(description = "状态开始时间")
    private Date starStatusTime;
    @Schema(description = "状态结束时间")
    private Date endStatusTime;
    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Schema(description = "用户备注")
    private String userRemark;
    @Schema(description = "是否删除（是:1，否:0）")
    @TableLogic(value = "0", delval = "1")
    private Integer userIsdelete;
}
